package com.sfilyh.servelt.admin;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.sfilyh.util.DBUtil;
import com.sfilyh.util.StringUtils;


@WebServlet("/bz-admin/updateCsort")
public class updateCategorySort extends HttpServlet {
	
	private static final long serialVersionUID = 1L;
	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
	  String id = 	request.getParameter("id");
	  String sort =  request.getParameter("sort");
	  
	  if(StringUtils.validate(id,sort)){
		  DBUtil.update("UPDATE tb_category SET sort = ? WHERE id = ?", sort,id);		  
	  }	  
	}

}
